<template>
  <div id="dz_market" class="page in" data-title>
    <div class="container backFFF">
      <header>
        <a href="javascript:void(0);" class="pa back" @click="nfgotome"></a>
        <p>同行数据录入</p>
        <a href="javascript:void(0);" class="pa add" @click="nfgoto"></a>
      </header>

      <div class="peer-wrap">
        <div class="peer-ul">
          <div class="peer-li" v-for="(item, index) in items" :key="index" :data-peerid="item.peer_id" @click="gotodetail">
            <div class="peer-model flex-wrap-between">
              <span>{{item.series_model}}</span>
              <span>时间：{{item.at_time}}</span>
            </div>
            <div class="flex-wrap-between">
              <span>{{item.company}}</span>
              
            </div>
          </div>
 
        </div>
      </div>
    </div>
  </div>
</template>

<script>
var mySelf;
export default {
  data() {
    return { items:[] };
  },beforeCreate() {
			this.$myUtils.isLoginGotoPage();	
		},
  mounted() {
    mySelf = this;
    this.init();
  },
  methods: {
    init: function () {
       uni.showToast({
							title: '正在加载数据',
							icon:'loading',
							duration:300
                        });
        this.$myUtils.myRequest({
					 url: '/Peer/getList',
				}).then(res => {	
          if (res.statusCode==200) {
              if (res.data.status==200) {
                  mySelf.items = res.data.data; 
              }
          } else {
              return uni.showToast({
                  title: '失败' ,
                  icon:'loading',
                  duration:1000
              });
          }

        })	
    },
    nfgoto:function() {
        uni.redirectTo({
          url: '/pages/peer/peeradd'
        });
   
    },
    gotodetail:function(ev) {
        let id = ev.currentTarget.dataset.peerid ;
        uni.navigateTo({
          url: '/pages/peer/peerdetail?id=' + id
        });
    },
     nfgotome:function(){     
          uni.reLaunch({  
            url: '/pages/personal/me'
          });
      }
     
  },
};
</script>

